#!/usr/bin/python3
# coding: utf-8
from flask import Flask
import click


app = Flask(__name__)
app.config.from_object('config')


from app import views
from app.models import db


db.init_app(app)
app.register_blueprint(views.item_views.bp)
app.register_blueprint(views.monitor_views.bp)

# ***线上禁用***
# 创建表可选的
@app.cli.command()
def initdb():
	'''
	app需要先开启, 否则找不到这个命令
	Usage: >flask initdb
	'''
	db.drop_all()
	db.create_all()
	click.echo('Init the db')
